#include "Axis.h"
#include "base.h"
Axis::Axis()
{
	m_fAxisLength = 0.5f;
}
Axis::~Axis()
{
}
void Axis::Draw(IRenderer *pRenderer)
{
	//Draw axis Center
	pRenderer->SetBillboarding(true);
	pRenderer->SetFillMode(FM_Border);
	pRenderer->SetColor(color::White);
	pRenderer->DrawRect3D(m_position - vector3(0.25f, 0.25f, 0.0f), vector2(0.5f, 0.5f), vector3(), vector2(0.25f,0.25f));
	pRenderer->SetBillboarding(false);

	//Draw the x, y and z axes
	vector3 zAxis = vector3(0.0f, 0.0f, m_fAxisLength) + m_position;
	vector3 yAxis = vector3(0.0f, m_fAxisLength, 0.0f) + m_position;
	vector3 xAxis = vector3(m_fAxisLength, 0.0f, 0.0f) + m_position;

	vector2 textSize(0.1f,0.1f);
	
	pRenderer->SetColor(color::Red);
	pRenderer->DrawLine(m_position, xAxis, 5.0f);
	//pRenderer->DrawTextOneLine(xAxis, textSize, "X", color::White);
	pRenderer->SetColor(color::Green);
	pRenderer->DrawLine(m_position, yAxis, 5.0f);
	//pRenderer->DrawTextOneLine(yAxis, textSize, "Y", color::White);
	pRenderer->SetColor(color::Blue);
	pRenderer->DrawLine(m_position, zAxis, 5.0f);
	//pRenderer->DrawTextOneLine(zAxis, textSize, "Z", color::White);*/
}